package cn.itsource.order.mapper;


import cn.itsource.basic.util.LoginInfoUtil;
import cn.itsource.order.domain.OrderAddress;
import cn.itsource.order.domain.UserAddress;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

public interface UserAddressMapper extends Mapper<UserAddress> {
    default List<UserAddress> findUserAddress(){
        Example example = new Example(UserAddress.class);
        Long userId = LoginInfoUtil.getUserId();
        example.and().andEqualTo("userId",userId);
        List<UserAddress> userAddresses = this.selectByExample(example);
        return userAddresses;
    }
}
